package com.plian.system.wrapper.pm.property;

import com.plian.system.entity.pm.property.ContributorBasics;
import com.plian.system.vo.pm.property.ContributorBasicsVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

import static com.plian.system.wrapper.util.WrapperConstant.DICT_CODE_TO_NAME;
import static com.plian.system.wrapper.util.WrapperConstant.SPRING;

@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface ContributorBasicsWrapper {

    @Mappings(value = {
            @Mapping(source = "category", target = "categoryName", qualifiedByName = DICT_CODE_TO_NAME)
    })
    ContributorBasicsVO entityToVO(ContributorBasics entity);

    List<ContributorBasicsVO> entityToVO(List<ContributorBasics> entity);
}
